﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace SimpleServiceBus.Utilities
{
    public static class StringExtensions
    {
        public static string Elide(this string target,int maxLength)
        {
            if (string.IsNullOrEmpty(target) || target.Length <= maxLength)
                return target;
            return target.Substring(0, maxLength) + "...";
        }

        public static bool IsNonEmpty(this string target)
        {
            return target != null && target.Trim() != String.Empty;
        }
    }
}